package com.mk.cloud.common.enums;

import org.osgl.util.S;import com.mk.cloud.common.util.S2;

/**
 * Created by cc on 2016/11/19 0019.
 */

@SuppressWarnings("unused")
public enum DicCode {
    DIC_SUIT("DIC_SUIT","单位");//字典表中单位KEY,value

    private final String value;
    private final String desc;

    DicCode(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public boolean eq(String v) {
        return S.eq(v, value);
    }

    public String value() {
        return this.value;
    }

    public static boolean containValue(String value){
        return dicCode(value)!=null;
    }

    public static DicCode dicCode(String value){
        for (int i=0;i<DicCode.values().length;i++){
            if(S.eq(DicCode.values()[i].value(),value)){
                return DicCode.values()[i];
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }
}
